package com.wondertek.poms.dao.productrepo;

import com.wondertek.poms.dao.po.Product;
import com.wondertek.poms.dao.pojo.KeyValuePojo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface IProductDao extends JpaRepository<Product,Long> {

    @Query(value="select PRODUCT_ID from PRODUCT where PRODUCT_ID like ?1", nativeQuery = true)
    List<Long> getAllProductLike(String vo);

    @Query(value="select PRODUCT_ID from PRODUCT", nativeQuery = true)
    List<Long> getAllProduct();

    @Query(value="select * from PRODUCT where PRODUCT_ID in (?1) ", nativeQuery = true)
    List<Product> findInProductIDS(String productIdS);

    @Query(value="select * from PRODUCT where PRODUCT_ID = ?1 ", nativeQuery = true)
    Product findByProductID(String productId);

    /**
     *<p><b>Title:</b> findAllByProductId </p>
     *<p><b>Description:</b> 查询产品计费 </p>
     *@author gaozhengxing gaozhenghang@wondertek.com.cn
     *@date 2021/2/8 21:19
     *@param productId 产品id
     */
    @Query(value="select * from PRODUCT where PRODUCT_ID = ?1 ", nativeQuery = true)
    List<Product> findAllByProductId(String productId);
}
